package com.xingfly.model;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 评论
 * Created by SuperS on 2016/12/7.
 */
@Entity
@Table(name = "xf_comment")
public class Comment extends BaseModel {
    private int commentObjectType;
    private Long commentObjectId;
    @OneToOne
    @JoinColumn(name = "author_id")
    private User author;

    private String content;

    private Long commentParentId;//父级评论对象ID


    public int getCommentObjectType() {
        return commentObjectType;
    }

    public void setCommentObjectType(int commentObjectType) {
        this.commentObjectType = commentObjectType;
    }

    public Long getCommentObjectId() {
        return commentObjectId;
    }

    public void setCommentObjectId(Long commentObjectId) {
        this.commentObjectId = commentObjectId;
    }

    public User getAuthor() {
        return author;
    }

    public void setAuthor(User author) {
        this.author = author;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Long getCommentParentId() {
        return commentParentId;
    }

    public void setCommentParentId(Long commentParentId) {
        this.commentParentId = commentParentId;
    }

    @Override
    public String toString() {
        return "Comment{" +
                "commentObjectType=" + commentObjectType +
                ", commentObjectId=" + commentObjectId +
                ", author=" + author +
                ", content='" + content + '\'' +
                ", commentParentId=" + commentParentId +
                '}';
    }
}
